package net.neptech.service;

import com.baomidou.mybatisplus.extension.service.IService;
import net.neptech.model.workflow.Workflow;
import net.neptech.model.vo.WorkflowVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface WorkflowService extends IService<Workflow> {

    WorkflowVO getListByUniqueId(String uniqueId);

    void setMainWorkflow(String flowId);

    WorkflowVO getDetail(String flowId);

    Workflow getByFlowId(String flowId);

    Workflow getByFlowIdContainDeleted(String flowId);

    List<Workflow> getByUniqueId(String uniqueId);

    void updateByFlowId(Workflow Workflow);

    void stop(String flowId);

    @Transactional
//    @Lock4j(keys = {"#WorkflowVO.uniqueId"}, expire = 60000, acquireTimeout = 60000)
    void create(WorkflowVO workflowVO);

    void update(String flowId, String type, String groupId);

    List<String> getAllRelatedFlowId(List<String> flowIdList);

    void clearWorkflow(String uniqueId);
}
